<div class="fadeIn">
	<br>
	<ol class="breadcrumb" style="margin-bottom: 0px;">
		<li class="active"><span class="glyphicon glyphicon-home" style="color:#23527c"></span>&nbsp;
			<mainpage></mainpage>
		</li>
		<li class="active">业务工作台 / 短信发送 / 短信文件导入</li>
	</ol>
	<div class="marB15 clearfix">
		<form class="form-inline" action="uploadFile/out-excel" method="post" id="form">

		    <div class="control-group row marT15 marR10 left" style="margin-left:0px;">
		        <span class="search-name">时间选择</span>
				<div class="controls">
					<input type="text"  name="fileType" value="短信号码" style="display: none;">
					<input type="text" ng-model="searchData.startDate"  placeholder="" name="startDate" style="display: none;">
                    <input type="text" ng-model="searchData.endDate"   placeholder="" name="endDate" style="display: none;">
					<div class="input-prepend input-group">
						<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span><input type="text" readonly style="width: 155px"  id="sendFileDate" class="form-control" />
						<span class="input-group-addon" ng-click='clearTime()'>清空</span>
					</div>
				</div>
			</div>

			<div class="left marT15 marR10">
				<span class="search-name">业务端类型</span>
				<select class="form-control1" ng-change='getSms()' ng-model="searchData.svrNode" name="svrNode">
					<option value="">全部</option>
					<option value={{row.SVR_NODE}} ng-repeat="row in listData1">{{row.SVR_NODE_NAME}}</option>
				</select>
			</div>
			<div class="left marR10 marT15">
				<span class="search-name">短信类型</span>
				<select class="form-control1" ng-model="searchData.serviceCode" name="serviceCode">
					<option value="">全部</option>
					<option value={{row.serviceCode}} ng-repeat="row in listData2">{{row.serviceName}}</option>
				</select>
			</div>
			<!--<div class="input-group line2 left">
				<span class="input-group-addon">接收号码</span>
				<input type="text" class="form-control" placeholder="" ng-model="searchData.userNo" name="userNo">
			</div>-->

		</form>
		<a href="javascript:;" class=" btn btn-sm btn-primary left marT15 marR10" id="search" ng-click='search()'><span class="glyphicon glyphicon-search"></span></a>
		<a class=" btn btn-primary btn-sm left marT15" data-toggle="modal" data-target="#import"  ng-click='importFiole("导入")'>文件导入</a>
		<div class="right marT15" style="position:relative">
			<button class="btn btn-sm btn-primary" ng-click='outExcel()'><img style="width:25px; height:20px;" src="img/excel.png">导出表格<span ng-style='loadStyle' class="outExcelLoad"><img  src="img/load.gif"></span>
            </button>
		</div>
	</div>
	<!--<div class="row">
                <div class="col-md-12  sends ">WEB短信文件导入记录</div>
            </div>-->

   <div class="table-box">

	<table class="table table-bordered table-striped text-center bg-info">
		<thead>
			<tr class="info">
				<th class="text-center">序号</th>
				<th class="text-center">日期</th>
				<th class="text-center">导入文件名</th>
				<th class="text-center">业务端名称</th>
				<th class="text-center">短信类型名称</th>
				<th class="text-center">发送端口</th>
				<th class="text-center">导入文件类型</th>
				<th class="text-center">短信内容</th>
				<th class="text-center">导入成功记录</th>
				<th class="text-center">导入失败记录</th>
				<th class="text-center">导入操作人</th>
				<th class="text-center">操作时间</th>
				<th class="text-center">状态</th>
				<th class="text-center">发送短信说明</th>
				<th class="text-center">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="Item in result">
				<td>{{ $index+1 }}</td>
				<td class="w115">{{ Item.uptimeDate | timeFormat}}</td>
				<td class="w115">{{ Item.fileName }}</td>
				<td class="w115">{{ Item.svrNodeName }}</td>
				<td class="w115">{{ Item.serviceName }}</td>
				<td class="w85">{{ Item.sendPort }}</td>
				<td class="w115">{{ Item.fileType }}</td>
				<td style="min-width: 400px; word-break : break-all">
				<a data-toggle="modal"
				   data-target="#showSmsMessage"
				   ng-click='showSmContent(Item.smContent)'>
				   {{ Item.smContent | showSms}}</a>
				</td>
				<td class="w115"><a ng-click="GoDetail(Item.uptime,'1',Item.fileId)">{{ Item.okLines }}</a></td>
				<td class="w115"><a ng-click="GoDetail(Item.uptime,'0',Item.fileId)">{{ Item.failLines }}</a></td>
				<td class="w115">{{ Item.userName }}</td>
				<td class="w85">{{ Item.uptime }}</td>
				<td class="w115">
					<span ng-if='"0"==Item.auditStatus'>待审核</span>
					<span ng-if='"1"==Item.auditStatus'>审核通过</span>
					<span ng-if='"2"==Item.auditStatus'>审核不通过</span>
				</td>
				<td style="min-width: 200px; word-break: break-all;">{{ Item.remark }}</td>
				<td style="min-width: 160px;">
					<a class="marR10"
						data-toggle="modal"
						data-target="#import"
						ng-click="importFiole('修改',Item.fileId)"
						ng-show='Item.auditStatus!="1"'>修改
					</a>
					<a ng-click="changeStstus(Item.auditStatus,Item.fileId)"
					   ng-show='Item.auditStatus!="1"'
					   class="marR10"
					   data-toggle="modal"
					   data-target="#audit">审核
					</a>
					<span class='marR10' ng-show='Item.auditStatus=="1"'>已审核</span>
					<a class=""
						data-toggle="modal"
						data-target="#delete"
						ng-show='Item.auditStatus!="1"'
						ng-click="delete(Item.fileId,$index)">删除
					</a>
				</td>
			</tr>
			<tr></tr>
		</tbody>
	</table>
 </div>


	<div class="flip">
		<page></page>
	</div>
</div>
<!-- <form name="form_upload" id="uploadForm" method="post" enctype="multipart/form-data">
          <input name="file" type="file" id="file" />
          <input name="fileType" type="hidden" value="错误码" />
          <input type="button" value="Upload" id="uploadBtn" />
</form> -->
<!-- 审核 -->
<div class="modal fade" id="audit" tabindex="-1" role="dialog" aria-labelledby="audit">
	<div class="modal-dialog" role="document">
		<div class="modal-content" style="width:620px">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="">审核</h4>
			</div>
			<div class="modal-body">
				<div class="row marB15">
					<div class="col-xs-12">
						<label class="left"><span>审核结果</span></label>
						<select class="form-control" ng-model="sendData.auditStatus">
							<option value="0">待审核</option>
							<option value="1">审核通过</option>
							<option value="2">审核不通过</option>
						</select>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-primary btn-sm" ng-click="sendAjax()">审核</button>
			</div>
		</div>
	</div>
</div>

<!-- 删除模态框 -->
<div class="modal fade" id="delete">
  <div class="modal-dialog">
    <div class="modal-content message_align">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
        <h4 class="modal-title">提示信息</h4>
      </div>
      <div class="modal-body">
        <p>您确认删除吗？</p>
      </div>
      <div class="modal-footer">
         <input type="hidden" id="url"/>
         <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
         <a class="btn btn-primary" data-dismiss="modal" ng-click='deleteTr()'>确定</a>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>


<!--导入弹出框-->
<div class="modal fade" tabindex="-1" role="dialog" id="import">
	<div class="modal-dialog modal-lg" role="document" style="width: 700px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">{{popup}}短信文件</h4>
			</div>
			<div class="modal-body" style="padding-bottom: 0px;">
				<form class="form-horizontal" name="form_upload" id="uploadForm" method="post" enctype="multipart/form-data">
					<div class="marT15 clearfix" style="margin-left:20px;">
					    <input type="text" style="display: none" id="fileId1" name="fileId">
						<input name="fileType" type="hidden" value="短信号码" />
						<div class="input-group line2 left marT15" style="width: 250px;">
							<span class="input-group-addon">业务端名称：</span>
							<select name="svrNode" class="form-control"
							ng-model="addData.svrNode"
							ng-change='getServiceCode()'>
								<option value="">--请选择--</option>
								<option value={{row.SVR_NODE}} ng-repeat="row in listData1">{{row.SVR_NODE_NAME}}</option>
							</select>
						</div>
						<div class="input-group line left marT15" style="width: 250px">
							<span class="input-group-addon">短信类型：</span>
							<select name="serviceCode" class="form-control"
							ng-model="addData.serviceCode"
							ng-change='addServiceCode()'
							name="serviceCode">
								<option value="">--请选择--</option>
								<option value={{row.serviceCode}} ng-repeat="row in serviceList">{{row.serviceName}}</option>
							</select>
						</div>
						<div class="input-group line2 left marT15" style="width: 250px">
							<span class="input-group-addon">用户扩展码：</span>
							<input name="sendPort" type="text" class="form-control" placeholder="" ng-model="addData.sendPort"
                            ng-keyup="addSendPort()"
							name="sendPort">
						</div>
					</div>
					<div class="form-group marT15">
						<label class="col-sm-3 control-label">发送方式:</label>
						<div class="col-sm-9">
                            <!-- <input name="sendMode" type="text" ng-model="addData.sendMode" style="display: none;" > -->
							<label class="radio-inline ">
                                <input class="isInit" type="radio" name="sendMode" value="2" checked="checked"> 号码群发
                            </label>
							<label class="radio-inline">
                                <input class="isOut" type="radio" name="sendMode" value='3'> 上传短信文件发送
                            </label>
						</div>
					</div>
					<!--号码群发-->
					<div class="phone">
						<input type="text" style="display: none" id="fileFormat" name="fileFormat" ng-model="addData.fileFormat">
						<div class="form-group">
							<label class="col-sm-3 control-label">短信模板下载:</label>
							<div class="col-sm-9" style="margin-bottom: 10px;">
								<select name="fileFormat" class="form-control"
										style="width: 154px;display: inline-block;"
										ng-model="addData.fileFormat"
										ng-change='selFileFormat()'
										name="fileFormat">
									<option value="">--请选择--</option>
									<option value="txt">txt</option>
									<option value="csv">csv</option>
									<option value="xls">xls</option>
									<option value="xlsx">xlsx</option>
								</select>
								<button class="btn btn-primary btn-sm downloadFiled" ng-click="download()">下载</button>
							</div>

							<label class="col-sm-3 control-label">请上传群发号码文件:</label>
							<div class="col-sm-9">
								<input name="file" type="file" id="file1" class="form-control line4" style="width:250px"
								ng-model='addData.fileName1'
								ng-change='changeFile($event)'
								  >
								<label
								   id="fileName1"
								   class="hideLabel"
								   ng-click='hideLabel($event)'
								   ng-style='isHide'
								 >{{addData.file1}}</label>
								 <input type="text" ng-model='isEdit' name="isEdit" style="display: none">
								<br>
								<p>说明：上传群发号码文件格式是每行1个号码。</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">发送短信内容:</label>
							<div class="col-sm-9">
								<textarea name="smContent"  cols="70" rows="5" class="form-control" ng-model="addData.smContent" style="width:380px;"></textarea>
								<!-- <span class="content-limit">{{addData.smContent.length}}/300</span> -->
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">短信发送说明:</label>
							<div class="col-sm-9">
								<textarea name="remark" cols="70" rows="2" class="form-control" style="width:380px;" ng-model="addData.remark"></textarea>
							</div>
						</div>
					</div>
				</form>
					<!--上传短信文件发送-->
				<form class="form-horizontal upFile" name="form_upload" id="addUploadForm" method="post" enctype="multipart/form-data">
				    <input type="text" style="display: none" id="sendMode" name="sendMode">
                    <input type="text" style="display: none" id="fileId2" name="fileId">
					<input type="text" style="display: none" id="svrNode" name="svrNode" ng-model="addData.svrNode">
                    <input type="text" style="display: none" id="serviceCode" name="serviceCode" ng-model="addData.serviceCode">
                    <input type="text" style="display: none" id="sendPort" name="sendPort" ng-model="addData.sendPort">
                    <input type="text" style="display: none" name="fileType" value="短信号码">

					<div class="form-group">
						<label class="col-sm-3 control-label">短信模板下载:</label>
						<div class="col-sm-9" style="margin-bottom: 10px;">
							<select name="fileFormat" class="form-control"
									style="width: 154px;display: inline-block;"
									ng-model="addData.fileFormat"
									ng-change='selFileFormat()'
									name="fileFormat">
								<option value="">--请选择--</option>
								<option value="txt">txt</option>
								<option value="csv">csv</option>
								<option value="xls">xls</option>
								<option value="xlsx">xlsx</option>
							</select>
							<button class="btn btn-primary btn-sm downloadFiled" ng-click="download()">下载</button>
						</div>
						<label class="col-sm-3 control-label">请上传短信文件:</label>
						<div class="col-sm-9">
							<input name="file" type="file" id="file2"  class="form-control line4" placeholder="" style="width:250px;"
							ng-model='addData.fileName2'
							ng-change='changeFile($event)'>
							<label
							   id='fileName2'
							   class="hideLabel"
							   ng-click='hideLabel($event)'
							   ng-style='isHide'
							 >{{addData.file2}}</label>
							 <input type="text" ng-model='isEdit' name="isEdit" style="display: none">

							<br>
							<p>说明：上传短信文件格式：接收号码|短信内容，每行一条记录</p>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label">短信发送说明:</label>
						<div class="col-sm-9">
							<textarea name="remark" cols="70" rows="6" class="form-control" ng-model="addData.remark" style="width:380px"></textarea>
						</div>

					</div>
				</form>
				<br>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-primary" ng-click="daoru()">保存</button>
			</div>
		</div>
	</div>
</div>


<!-- 加载提示框 -->
<div id="statusTip" ng-style='statusLoad'>
    <div id="statusBox">
     <img src="img/load.gif" style="width:50px; height:50px; position: relative; left:55px; margin-bottom: 15px;"><p style="color: #fff;">正在{{loadStatus}}，请稍候....</p>
    </div>
</div>
 <!-- 加载框 -->
   <span class='loaded' ng-show='loaded'><img  src="img/load.gif"></span>
 <!-- 加载框 完成-->
<!-- 显示信息详情 -->
<div class="modal fade" id="showSmsMessage">
  <div class="modal-dialog">
    <div class="modal-content message_align">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
        <h4 class="modal-title">信息详情</h4>
      </div>
      <div class="modal-body bg-info">
        <p style="padding-bottom: 20px; margin-bottom: 0px;">{{showSmsMessage}}</p>
      </div>
      <div class="modal-footer">
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>
